<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8"> 
	<title>测试</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
    <script src="js/upload.js" type="text/javascript"></script>
</head>
<body>

    <h3>拖拽图片到下框或点击选择图片</h3>
    <div id="drop_area"></div>


    <script type="text/javascript">
        var dragImgUpload = new DragImgUpload("#drop_area", {
            callback:function (files) {
                //回调函数，可以传递给后台等等
                var file = files[0];
                console.log(file.name);
            }
        })
    </script>

</body>
</html>
